<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>仪表盘 - FinalCMS Admin</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<link rel="stylesheet" href="${ctx}/css/bootstrap.min.css" />
<link rel="stylesheet" href="${ctx}/css/font-awesome.min.css" />
<link rel="stylesheet" href="${ctx}/css/jquery-ui.custom.min.css" />
<link rel="stylesheet" href="${ctx}/css/jquery.gritter.css" />
<!--[if lte IE 9]>
<link rel="stylesheet" href="${ctx}/css/fc-part2.min.css" />
<![endif]-->
<link rel="stylesheet" href="${ctx}/css/fc-skins.min.css" />
<link rel="stylesheet" href="${ctx}/css/fc-rtl.min.css" />
<link rel="stylesheet" href="${ctx}/css/fc-fonts.css" />
<link rel="stylesheet" href="${ctx}/css/fc.min.css" />
<link rel="stylesheet" href="${ctx}/css/fc-custom.css" />

<!--[if lte IE 9]>
 <link rel="stylesheet" href="${ctx}/css/fc-ie.min.css" />
<![endif]-->

<!--[if lte IE 8]>
<script type="text/javascript" src="${ctx}/js/html5shiv.js"></script>
<script type="text/javascript" src="${ctx}/js/respond.min.js"></script>
<![endif]-->
</head>

<body class="no-skin">
<?include("../../inc/menu.html",{current:"friendlink_add"}){}?>
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
	<script type="text/javascript">
		try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
	</script>

	<ul class="breadcrumb">
		<li><i class="ace-icon fa fa-home home-icon"></i> <a href="${ctx}/admin/index">首页</a>
		</li>
		<li class="active">添加外链</li>
	</ul>
	<div class="nav-search" id="nav-search">
		<form class="form-search">
			<span class="input-icon"> 
				<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
				<i class="ace-icon fa fa-search nav-search-icon"></i>
			</span>
		</form>
	</div>
</div>

<div class="page-content">
	<?include("../../inc/function.html"){}?>
	<div class="page-header">
			<h1>友情链接
			<small><i class="ace-icon fa fa-angle-double-right"></i> <?if(isEmpty(f)) {?>添加<?}else{?>编辑<?}?></small>
			</h1>
		</div>
		<div class="row">
			<div class="col-xs-12">
			<form id="frm" class="form-horizontal" role="form" method="post">
				<input type="hidden" name="status" id="status" />
				<?if(!isEmpty(f)) {?>
				<input type="hidden" name="id" id="id" value="${f.id}"/>
				<?}?>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1">关键词</label>
					<div class="col-sm-9">
						<input type="text" id="keyword" name="keyword" value="${f.keyword!}" placeholder="关键词" class="col-xs-10 col-sm-5" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1">链接地址</label>
					<div class="col-sm-9">
						<input type="text" id="url" name="url" value="${f.url!}" placeholder="链接地址" class="col-xs-10 col-sm-5" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1">logo地址</label>
					<div class="col-sm-9">
						<input type="text" id="logo" name="logo" value="${f.logo!}" placeholder="logo地址" class="col-xs-10 col-sm-5" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-1"></label>
					<span class="help-inline col-xs-1 col-sm-1">
						<label class="middle">
							<input class="ace" type="checkbox" id="_status" checked="checked" />
							<span class="lbl"> 启用</span>
						</label>
					</span>
				</div>
				<div class="clearfix form-actions">
					<div class="col-md-offset-3 col-md-9">
						<button class="btn btn-info" type="button" id="submitBtn">
							<i class="ace-icon fa fa-check bigger-110"></i> 提交
						</button>
						&nbsp; &nbsp; &nbsp;
						<button class="btn" type="reset">
							<i class="ace-icon fa fa-undo bigger-110"></i> 重置
						</button>
					</div>
				</div>
			</form>
			</div>
		</div>
	</div>
</div>
</div>
<?include("../../inc/footer.html"){}?>

<script type="text/javascript" src='${ctx}/js/jquery1.11.0.min.js'></script>
<script type="text/javascript" src="${ctx}/js/bootstrap.min.js"></script>
<!--[if lte IE 8]>
<script type="text/javascript" src="${ctx}/js/excanvas.min.js"></script>
<![endif]-->

<script type="text/javascript" src="${ctx}/js/fc-extra.min.js"></script>
<script type="text/javascript" src="${ctx}/js/fc.min.js"></script>
<script type="text/javascript">
jQuery(function($) {
	$("#submitBtn").click(function(){
		if($.trim($("#keyword").val()).length == 0) {
			alert("关键词不能为空");
			return false;
		}
		if($.trim($("#url").val()).length == 0) {
			alert("链接地址不能为空");
			return false;
		}
		if($("#_status").is(":checked")) {
			$("#status").val(1);
		} else {
			$("#status").val(0);
		}
		
		<?if(isEmpty(f)) {?>
		$("#frm").attr("action", "${ctx}/admin/friendlink/add");
		<?}else{?>
		$("#frm").attr("action", "${ctx}/admin/friendlink/edit");
		<?}?>
		
		$("#frm").submit();
	});
});
</script>
</body>
</html>
